# 作者: 薛文寅仟
# 2024年12月30日11时58分52秒
# 5443912@qq.com
class Person:
    def __init__(self, name, weight):
        self.name = name
        self.weight = weight

    def __str__(self):
        return f'我的名字是{self.name},体重{self.weight}'

    def run(self):
        self.weight -= 0.5
        print(f'{self.name}爱跑步,体重变成{self.weight}')

    def eat(self):
        self.weight += 1
        print(f'{self.name}爱吃东西,体重变成{self.weight}')


if __name__ == '__main__':
    elephant = Person("大象", 80)
    tiger=Person("老虎",75)
    elephant.run()
    elephant.eat()
    tiger.run()
    tiger.run()
    print(elephant)
    print(tiger)